<?php

public function index($father=0){
    $this->assignTitle('地区管理');
    $r = apiCall(AreaApi::QUERY,array(array('father'=>$father),array('curpage'=>$p,'size'=>10)));
    // dump($r);exit;
    if(!$r['status']) $this->error($r['info']);
    $this->assign('father',$father);
    $this->assign('list',$r['info']['list']);
    $this->assign('show',$r['info']['show']);
    $this->display('Area/index_a');
}

public function delete($id){
    $r = apiCall(AreaApi::DELETE,array(array('id'=>$id)));
    // dump($r);exit;
    if(!$r['status']) $this->error($r['info']);
    else $this->success('修改成功');
}

public function add($father){
    $r = apiCall(CityApi::GET_INFO,array(array('cityID'=>$father)));
    if(!$r['status']) $this->error($r['info']);
    if(IS_GET){
        $this->assign('entry',$r['info']);
        $this->display('Area/add_a');
    }elseif(IS_AJAX){
        $map           = array();
        $map['areaID'] = I('post.areaID');
        $map['area']   = I('post.area');
        $map['father'] = $father;
        $this->upd($map,$father);
    }
}
?>